package org.hcf.data.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 聊天消息
 * </p>
 *
 * @author xianiyitiao
 * @since 2024-05-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="ChatMsg对象", description="聊天消息")
public class ChatMsg extends Model<ChatMsg> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "msg_id")
    @ApiModelProperty(value = "消息主键")
    private Long msgId;

    @ApiModelProperty(value = "消息发送者本地唯一编号")
    private Long localId;

    @ApiModelProperty(value = "发送人")
    private Long fromId;

    @ApiModelProperty(value = "接收人")
    private Long toId;

    @ApiModelProperty(value = "消息类型(0.文字,1.文件,2.图片,3.视频,4.音频,5.名片,6.公告)")
    private byte msgType;

    @ApiModelProperty(value = "聊天类型(0.好友聊天,1.群聊)")
    private byte talkType;

    @ApiModelProperty(value = "消息内容")
    private String content;

    @ApiModelProperty(value = "音频时长")
    private Integer audioTime;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "玩家是否已接收")
    private boolean receive;


    @Override
    protected Serializable pkVal() {
        return this.msgId;
    }

}
